<!DOCTYPE html>
<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
    <head>
        <?php
        $baseUrl = Yii::app()->theme->baseUrl;
        $cs = Yii::app()->getClientScript();
        Yii::app()->clientScript->registerCoreScript('jquery');
        ?>
        <meta charset="utf-8">
        <title><?php echo CHtml::encode($this->pageTitle); ?></title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
        <?php if (Yii::app()->controller->id != 'courses' && Yii::app()->controller->id != 'classes') { ?>
            <meta name="description" id="metadiscription" content="Learn Skills | Courses Workshops | Delhi,Gurgaon,Noida | Food, Arts, Music, Dance, Sports">
        <?php } ?>
        <link rel="icon" href="<?php echo ThemePath(); ?>/images/twitt.png" type="image/png" />
        <link rel="shortcut icon" href="<?php echo ThemePath(); ?>/favicon.ico" type="image/x-icon" />
        <meta name="viewport" content="width=device-width">
        <meta name="keywords" content="Food, Arts, Music, Dance, Sports,learn, learning, class, classes, teach, education, how to, hybrid learning, collaborative learning">
        <meta name="author" content="Skillhippo">
        <script src="<?php echo ThemePath(); ?>/js/bootbox.js"></script> <?php
        $userid = getLoginUserId();
        if (!empty($userid)) {
            $cs->registerScriptFile($baseUrl . '/js/jquery-1.11.0.min.js');
        }
        $cs->registerScriptFile($baseUrl . '/js/vendor/bootstrap.min.js');
        $cs->registerScriptFile($baseUrl . '/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js');
        $cs->registerScriptFile($baseUrl . '/js/owl.carousel.min.js');
        $cs->registerScriptFile($baseUrl . '/js/main.js');
        $cs->registerScriptFile($baseUrl . '/js/bootstrap-datepicker.js');
        Yii::app()->getClientScript()->registerCoreScript('jquery', CClientScript::POS_END);
        ?>
        <?php
        $cs->registerCssFile($baseUrl . '/css/bootstrap.min.css');
        $cs->registerCssFile($baseUrl . '/css/bootstrap-theme.min.css');
        $cs->registerCssFile($baseUrl . '/css/main.css');
        $cs->registerCssFile($baseUrl . '/css/owl.carousel.css');
        ?>
        <!--[if lt IE 9]>
            <script src="js/html5shiv.js"></script>
            <![endif]-->
        <!-- Jquery For the Getting Values from Search Input -->
        <script>
            function setAuthKey(authKey, action) {
                $.post("<?php echo Yii::app()->createUrl("/classes/setAuthKey"); ?>", {'YII_CSRF_TOKEN': $('input[name="YII_CSRF_TOKEN"]').val(), authKey: authKey, action: action}, function(result) {
                    window.location.href = result;
                });
            }
            function imageloding() {
                $.blockUI({message: '<h5 class="fnt-size15 padding10px"><img style="margin-right:30px;"src="<?php echo ThemePath() . '/images/hippo-loader.gif'; ?>" /></h5>'});
            }
            $(document).ready(function(e) {
                $('#shopping-cart').on('click', function() {
                    viewshopingcart(1);
                });
            });

            function openloginPanel() {
                window.location = "#top-position";
                $("#login-panel").slideToggle();
            }
            function viewshopingcart(slidetoggale) {
                //where is call this function use for show shooping cart value=1 and not toggle value=2;
                window.location = "#top-position";
                jQuery.ajax({
                    'type': 'POST',
                    'url': "<?php echo Yii::app()->createAbsoluteUrl("ShoppingCart/View"); ?>",
                    'data': 'YII_CSRF_TOKEN=' + $('input[name="YII_CSRF_TOKEN"]').val(),
                    'beforeSend': function(jqXHR, settings) {
                        jQuery('#progressbarshoppingcart').show();
                    },
                    'success': function(data) {
                        jQuery('#progressbarshoppingcart').hide();
                        $(".shoppingcart-data").html(data);
                        if (slidetoggale == 1) {
                            $('#shopping-panel').slideToggle();
                        }

                    },
                    'cache': false
                });
            }

            /* Remove from shopping cart */
            function removeClassBatch(id) {
                bootbox.confirm("Are you sure want to remove class from shopping cart ?", function(result) {
                    if (result != false) {
                        $.post("<?php echo Yii::app()->createUrl("ShoppingCart/delete"); ?>", {'YII_CSRF_TOKEN': $('input[name="YII_CSRF_TOKEN"]').val(), batchId: id}, function(result) {
                            var obj = jQuery.parseJSON(result);
                            if (obj.status == 1) {
                                $('.shopingaddvaluecartvalue').html(obj.shopngcartitem);
                                viewshopingcart(2);
                            }
                        });
                    }

                })
            }


            function QuantityUpdate(qty, id, classcoursetype, displayid, batchtiming, startdate, venueid, classes_id) {
                // jConfirm('Are you sure want to update quantity ?', function (resultconfirm) {
                bootbox.confirm("Are you sure want to update quantity ?", function(result) {
                    if (result != false) {
                        $.post("<?php echo Yii::app()->createUrl("ShoppingCart/update"); ?>",
                        {'YII_CSRF_TOKEN': $('input[name="YII_CSRF_TOKEN"]').val(), batchId: id, qty: qty, classcoursetype: classcoursetype, startdate: startdate, batchtiming: batchtiming, classes_id: classes_id}, function(result) {
                            if (result == 1) {
                                viewshopingcart(2);
                            } else {
                                var noofseats = result.split("#@#");
                                var totalSeats = noofseats[0];
                                var expactedSeats = noofseats[1];
                                $("#" + displayid).html("Availability:" + totalSeats);
                                setTimeout(function() {   //calls click event after a certain time
                                    viewshopingcart(2);
                                }, 1000);
                            }
                        });
                    }
                })
                // });
            }

            function checkcouponcode() {
                var matchIds = "";
                var discount_code = $("#discount_id").val();
                var total_amt = $("#amount").val();
                if (discount_code == "") {
                    $("#discount_error").html("Please insert value");
                } else {
                    $.post("<?php echo Yii::app()->createUrl("ShoppingCart/addDiscount"); ?>",
                    {'YII_CSRF_TOKEN': $('input[name="YII_CSRF_TOKEN"]').val(), discount_code: discount_code, total_amt: total_amt}, function(result) {
                        if (result != 1) {
                            $("#discount_error").show();
                            $("#discount_error").html("This coupon not valid!");
                            //viewshopingcart(2);
                        } else {
                            viewshopingcart(2);
                        }
                    });

                }
            }
        </script>
        <script type="text/javascript">  var _gaq = _gaq || [];
            _gaq.push(['_setAccount', 'UA-47042362-1']);
            _gaq.push(['_trackPageview']);

            (function() {
                var ga = document.createElement('script');
                ga.type = 'text/javascript';
                ga.async = true;
                ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
                var s = document.getElementsByTagName('script')[0];
                s.parentNode.insertBefore(ga, s);
            })();

        </script>
    </head>
    <style> #social-panel {  width: 24%; float: right;display: none;}</style>
    <body id="top-position">
        <!--[if lt IE 7]>
            <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
            <![endif]-->
        <!-- ===========   1.header section start here=======================-->
        <header id="header">
            <div class="container">
                <div class="row">
                    <div class="col-lg-offset-8 col-lg-4 col-sm-offset-6 col-sm-6 col-md-offset-4 col-md-8 col-xs-12">
                        <ul class="list-unstyled top-nav pull-right">
                            <li class="soc1"><a href="<?php echo FACEBOOK_LINK; ?>" target="_blank"></a></li>
                            <li class="soc2"><a href="<?php echo TWITTER_LINK; ?>" target="_blank"></a></li>
                            <li class="soc3"><a href="#" id="socialMedia"></a></li>
                            <li class="soc4"><a href="javascript:void(0)" id="shopping-cart"><span class="shopingaddvaluecartvalue"> <?php echo count(Yii::app()->shoppingCart->getPositions()); ?></span><span class="item-txt"> Items </span></a></li>

                        </ul>
                    </div>

                </div>

                <div id="progressbarshoppingcartshoppingcart" style="display:none;"></div>
                <div class="row">
                    <div class="col-lg-12 col-md-12 col-sm-12">
                        <div class="navbar navbar-inverse">
                            <div class="container">
                                <div class="navbar-header">
                                    <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
                                        <span class="icon-bar"></span>
                                        <span class="icon-bar"></span>
                                        <span class="icon-bar"></span>
                                    </button>
                                    <a class="navbar-brand" href="<?php echo SITE_URL; ?>">Skillhippo</a>

                                </div>

                                <div class="navbar-collapse collapse">                                    
                                    <ul class="nav navbar-nav head-list pull-right <?php
        if (!Yii::app()->user->isGuest) {
            echo 'headerpic';
        }
        ?>">
<!--                                        <li><a href="javascript:void(0);">Delhi</a></li>-->
                                        <li><a href="<?php echo Yii::app()->cms->createUrl('learn'); ?>">Learn</a></li>
                                        <li><a href="<?php echo Yii::app()->createUrl('/teach'); ?>">Teach</a></li>
                                        <?php if (!Yii::app()->user->isGuest) { ?> <li class="last-li"><a href="<?php echo Yii::app()->createAbsoluteUrl('/myskillhippo'); ?> ">myskillhippo</a></li>
                                            <li class="dropdown align-drop"><a href="#" data-toggle="dropdown" class="dropdown-toggle"><b class="caret"></b></a>
                                                <ul class="dropdown-menu">
                                                    <li><a href="<?php echo Yii::app()->createAbsoluteUrl('/site/logout'); ?> ">Logout</a></li>
                                                </ul>
                                            </li><?php } else { ?>
                                            <li><a href="javascript:void(0);" id="drop-login">Login</a></li> 
                                        <?php } ?>

                                    </ul>
                                </div><!--/.navbar-collapse -->
                                <div id="social-panel">           
                                    <div class="empty-wrap">

                                        <?php
                                        $socialUrl = (!empty($_GET)) ? "http://$_SERVER[HTTP_HOST]$_SERVER[REQUEST_URI]" : SITE_URL . 'site/index/';
                                        $this->widget('application.extensions.SocialShareWidget.SocialShareWidget', array(
                                            'url' => $socialUrl, //required
                                            //'services' => array('facebook,', 'twitter','google' ), //optional
                                            'htmlOptions' => array('class' => 'someClass'), //optional
                                            'popup' => true, //optional
                                        ));
                                        ?>
                                    </div>            

                                </div>
                            </div>
                        </div>
                    </div>
                </div><!-- Navigation Row Ends -->

            </div> <!-- Container Ends Here -->   
        </header> <!-- Header Ends Here -->
        <!--===================== Header Ends Here============================== -->

        <div class="clearfix"></div>
        <!-- carasoul section -->
        <!--========   2. Carousel Content  ==============->
        <!-- ========2.login slide start here =======-->
        <?php
        if (Yii::app()->user->isGuest) {
            $model = new LoginForm();
            $this->renderPartial('//users/_userlogin-signup', array('model' => $model));
        }
        ?>

        <!--=============login panel end ============---->

        <!--========= 3.shopping cart with items===================-->
        <section id="shopping-panel">
            <div class="container shopping-wrap">
                <h1>my shopping cart</h1>
                <div class="shoppingcart-data">

                </div>
            </div>
        </section>  

        <!--=============end  panel end ============---->  